package com.linzm.creationaltype.abstractfactory02.enums;

import com.linzm.creationaltype.abstractfactory02.Color.Blue;
import com.linzm.creationaltype.abstractfactory02.Color.Green;
import com.linzm.creationaltype.abstractfactory02.Color.Red;

/**
 * @Author zimingl
 * @Date 2023/4/15 12:32
 * @Description: 颜色枚举
 */
public enum ColorTypeEnum implements TypeInterface {
    RED("red", "红色", Red.class),
    GREEN("green", "绿色", Green.class),
    BLUE("blue", "蓝色", Blue.class);

    ColorTypeEnum(String type, String desc, Class<?> clazz) {
        this.type = type;
        this.desc = desc;
        this.clazz = clazz;
    }

    private final String type;

    private final String desc;

    private final Class<?> clazz;

    @Override
    public Class<?> getClazz() {
        return clazz;
    }

    @Override
    public TypeInterface getEnum(String type) {
        return ColorTypeEnum.valueOf(type);
    }
}
